/* eslint-disable react/prop-types */
import React, { useState } from "react"

// 函数组件
function Hello(props) {
  console.log(props);
  return (
    <>
      <h3>我是子组件---{props.value}</h3>
    </>
  )
}

// 类组件
class Footer extends React.Component {
  render() {
    console.log(this.props);
    return (
      <h4>我是类组件----{this.props.age}---{this.props.count}</h4>
    )
  }
}

function App() {
  const [value, setValue] = useState(100)
  return (
    <>
      <Hello name="鲁班" value={value} />
      <button onClick={() => setValue(value+1)}>父组件修改value</button>
      <Footer age="20" count={value} />
    </>
  )
}

export default App
